package com.lc.recovery.ui.activity.recoverymine;

import android.os.Bundle;

import com.bigkoo.pickerview.view.TimePickerView;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.flyco.tablayout.SlidingTabLayout;
import com.lc.recovery.R;
import com.lc.recovery.adapter.MyFragmentPagerAdapter;
import com.lc.recovery.app.AppActivity;
import com.lc.recovery.ui.fragment.BalanceRecordFragment;

import java.util.ArrayList;
import java.util.List;

import androidx.fragment.app.Fragment;
import androidx.viewpager.widget.ViewPager;
import butterknife.BindView;
import butterknife.ButterKnife;

public class BalanceRecordActivity extends AppActivity  {

    @BindView(R.id.slidingTabLayout)
    SlidingTabLayout slidingTabLayout;
    @BindView(R.id.viewpager)
    ViewPager viewpager;
    private List<String> dataBeanList = new ArrayList<>();
    private BaseQuickAdapter<String, BaseViewHolder> rvBalancerecordadapter;
    private MyFragmentPagerAdapter mAdapter;

    private List<String> titles = new ArrayList<>();//title集合

    private List<Fragment> fragments = new ArrayList<>();//碎片集合

    //时间选择器
    private TimePickerView pvTime;


    @Override
    protected int getLayoutId() {
        return R.layout.activity_balancerecord;
    }

    @Override
    protected void initView() {

    }

    @Override
    protected void initData() {

    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        // TODO: add setContentView(...) invocation
        ButterKnife.bind(this);

        viewpager.setOffscreenPageLimit(2);
        titles.add("全部");
        titles.add("入账");
        titles.add("出账");

        fragments.add(BalanceRecordFragment.newInstance(""));
        fragments.add(BalanceRecordFragment.newInstance("1"));
        fragments.add(BalanceRecordFragment.newInstance("2"));

        mAdapter = new MyFragmentPagerAdapter(getSupportFragmentManager(), fragments, getContext(), titles);
        viewpager.setAdapter(mAdapter);
        slidingTabLayout.setViewPager(viewpager);


    }

}
